<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>元素查找和过滤操作</title>
    <script src="../../../../../lib/JQuery3.7.1.js"></script>
</head>
<body>
  <ul>
    <li class="li1">
      <a></a>
    </li>
    <li class="li2" id="li2"></li>
    <li class="li3"></li>
  </ul>

<script>
  //find(selector|ele)后代
  console.log($('ul').find());
  //parents([selector])祖先
  console.log($('a').parents())
  //parent([selector])父
  console.log($('a').parent())
  //siblings([selector])所有兄弟
  console.log($('.li1').siblings())
  //next([selector])后一个兄弟
  console.log($('#li2').nextSibling)
  //prev([selector])前一个兄弟
  console.log($('.li2').previousSibling)
  //
</script>
</body>
</html>